<%@ WebHandler Language="C#" Class="imageUp" %>
<%@ Assembly Src="Uploader.cs" %>

using System;
using System.Web;
using System.IO;
using System.Collections;

public class imageUp : IHttpHandler
{
    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";

        //int _UserId = Common.TypeParse.ObjectToInt(context.Request.QueryString["UserId2"], 0);
        //HttpPostedFile file;
        //int width;
        //int height;
        //string fileName;
        //file = context.Request.Files[0];
        //string url = "";
        //string extesion = System.IO.Path.GetExtension(file.FileName);



        //Common.FileUploadHelper.FileUploadResult result = FileUploadHelper.FileUpload(file, QHW.Shop.Config.WebConfig.ImageSizeLimit, QHW.Shop.Config.WebConfig.ImageLimitExtensions, "", out width, out height, out fileName);
        //if (result == Common.FileUploadHelper.FileUploadResult.文件上传成功)
        //{
        //    url = FileUploadHelper.GetUploadWebUrl(fileName.Substring(0, fileName.LastIndexOf(".")) + extesion);

        //}
        //HttpContext.Current.Response.Write("{'url':'" + url + "','title':'" + file.FileName + "','original':'" + file.FileName + "','state':'" + (result == Common.FileUploadHelper.FileUploadResult.文件上传成功 ? "SUCCESS" : result.ToString()) + "'}");  //向浏览器返回数据json数据



    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}